list1=[1,2,3,4,5,6,7,8]
for i in list1:
    print(i,end='')
list1.append(9)
print(list1)
list2=['hello','world','']
list2.extend(list1)
print(list1)
print(list2)
list3=['hello','python']
list3.insert(2,'!')
print(list3)
list4=[5,3,8,6,9,11,50]
list5=[5,3,8,6,9,11,50]
list4.sort()
list5.reverse()
list5_2=sorted(list5)
print(list4)
print(list5)
print(list5_2)
#移除50
list5.remove(50)
print(list5)
list5.pop()
print(list5)
#集合
set1={1,2,3,4,5,6,7,8}
for i in set1:
    print(i,end='')
print('\n')
#字典
dict1={'name':'zhangsan','age':18}
for key,value in dict1.items():
    print(key,value)
dict1['sex']='男' #添加
dict1['age']=19 #更新
for key in dict1:
    print(key,end='')
print()
for key,value in dict1.items():
    print(key,value)

print(dict1.keys())